Repository navigation
🐛 Potentially fix crash on exit on iOS - #348
Merged
Merged
Conversation
Override the method for de-registering the plugin with the engine on shutdown. This crash is difficult to reproduce, but I have not been able to with this code enabled. Fixes #341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why?
Fix a crash on exit caused by Datadog logging that a view isn't active during an event, which is happening while the app is shutting down and a the Flutter engine, and therefore the method channel for displaying the log, is no longer available.
To fix, we're overriding the method provided by Flutter for de-registering the plugin with the engine on shutdown, but I've yet to see this called in practice.
Fixes #341
How?
This crash is difficult to reproduce, but I have not been able to with this code enabled in many attempts. I added some code to the RUM example to test stopping a view and immediately send an event on
disposeif one is active, which was able to reproduce the crash fairly consistently, and I have not been able to reproduce.Review checklist
CI Configuration (optional)